
import React, { Component} from 'react';
import classnames from 'classnames';
import format from 'src/utils/format'
import './Classify.scss';

let Classify = class extends Component {
  constructor(props) {
    super(props);
  }
  render() {
    let {className,data,separator}=this.props;
    //separator 表示是否要做过滤处理 默认处理
    if(!data||!data.length){
      return null;
    }
    return (
      <section className={classnames("classify-box ds-box",{[`${className}`]:true})}>
        {
        data.map((item,i)=>{
          return (
            <div className="c-column cm-flex" key={i}>
              <h6 className="c-i6-tit">{item.title}</h6>
              <p className="c-money">{separator==false?item.value:format.separator(item.value)}</p>
            </div>
          )
        })
        }
      </section>
    )
  }
}

export default Classify;